package com.chen.pojo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import javax.annotation.Resource;

public class User {

    private String name;
//    如果定义了Autowired中required属性为false，说明这个对象可以为空，否则不可以为空
//    @Autowired(required = false)
//    @Autowired
    @Resource(name = "tiger12")
    private Tiger tiger;
    @Autowired
    @Qualifier(value = "elment2")
    private Element element;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Tiger getTiger() {
        return tiger;
    }

//    public void setTiger(Tiger tiger) {
//        this.tiger = tiger;
//    }

    public Element getElement() {
        return element;
    }

    public void setElement(Element element) {
        this.element = element;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", tiger=" + tiger +
                ", element=" + element +
                '}';
    }
}
